{include file="public/layout" /}
<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<body class="eyou_body_xin">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="order/left" /}
<div id="geduan_div" class="h15"></div>
<div class="page" style="min-width:auto;margin-left:115px;padding-bottom: 15px;">
    <div class="fixed-bar">
        <div class="item-title">
            <ul class="tab-base nc-row">
                <li> <a href='{:url("Shop/index")}' {if condition="'index' == $Think.const.ACTION_NAME and '' == $Request.param.order_status"} class="current" {/if}>全部订单</a> </li>
                <li> <a href='{:url("Shop/index", ["order_status"=>9])}' {eq name="$Request.param.order_status" value="9"} class="current" {/eq}>待付款</a> </li>
                <li> <a href='{:url("Shop/index", ["order_status"=>1])}' {eq name="$Request.param.order_status" value="1"} class="current" {/eq}>待发货</a> </li>
                <li> <a href='{:url("Shop/index", ["order_status"=>2])}' {eq name="$Request.param.order_status" value="2"} class="current" {/eq}>已发货</a> </li>
                <li> <a href='{:url("Shop/index", ["order_status"=>3])}' {eq name="$Request.param.order_status" value="3"} class="current" {/eq}>已完成</a> </li>
            </ul>
            <div class="fr e-export">
                <a href="javascript:void(0);" onclick="OrderExcelExport(this);" data-url="{:url('Order/ajax_order_excel_export')}" class=""><i class="iconfont e-XLStubiao"></i>导出订单</a>
            </div>
        </div>
    </div>
    <div class="flexigrid flexigrid-xin">
        <div class="header-bar">
            <div class="more">
                <div class="search">
                    <div class="content">
                        <form id="searchForm" action="{:url('Shop/index')}" method="get" onsubmit="layer_loading('正在处理');" style="display: unset;">
                            {$searchform.hidden|default=''}
                            <input type="hidden" name="order_status" value="{$Request.param.order_status}">
                            <div class="ey-form-item"><label class="users-form-item-label">关键词：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <!-- 订单号查询 -->
                                            <div class="sDiv2">
                                                <input type="text" size="50" name="order_code" id="order_code" value="{$Request.param.order_code}" class="qsbox" style="width: 170px;" placeholder="订单号或商品名称...">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="ey-form-item"><label class="users-form-item-label">支付方式：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <div class="">
                                                <select name="pay_name" id="pay_name">
                                                    <option value="" {empty name="$pay_name"}selected{/empty}>全部</option>
                                                    <option value="admin_pay" {eq name="$pay_name" value="admin_pay"}selected{/eq}>后台支付</option>
                                                    <option value="balance" {eq name="$pay_name" value="balance"}selected{/eq}>余额支付</option>
                                                    {eq name="$shopOpenOffline" value="0"}
                                                    <option value="delivery_pay" {eq name="$pay_name" value="delivery_pay"}selected{/eq}>货到付款</option>
                                                    {/eq}
                                                    {eq name="$openWeChat" value="0"}
                                                    <option value="wechat" {eq name="$pay_name" value="wechat"}selected{/eq}>微信支付</option>
                                                    {/eq}
                                                    {eq name="$openAliPay" value="0"}
                                                    <option value="alipay" {eq name="$pay_name" value="alipay"}selected{/eq}>支付宝支付</option>
                                                    {/eq}
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
    
                            <div class="ey-form-item"><label class="users-form-item-label">订单来源：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <div class="">
                                                <select name="order_terminal" id="order_terminal">
                                                    <option value="0" {empty name="$order_terminal"}selected{/empty}>全部</option>
                                                    {empty name="$global.web_status"}
                                                    <option value="1" {eq name="$order_terminal" value="1"}selected{/eq}>电脑端</option>
                                                    <option value="2" {eq name="$order_terminal" value="2"}selected{/eq}>手机端</option>
                                                    {/empty}
                                                    <option value="3" {eq name="$order_terminal" value="3"}selected{/eq}>小程序</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
    
                            <div class="ey-form-item"><label class="users-form-item-label">下单时间：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <div class="sDiv2">
                                                <input type="text" name="add_time" id="eYLaydateTimeLinkage" data-max_date="{php}echo date('Y-m-d');{/php}" autocomplete="off"  class="qsbox" placeholder="商品下单时间" lay-key="1" style="width: 220px;" value="{$Request.param.add_time}">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <div class="ey-form-item" style="margin-left: 20px;">
                            <div class="users-form-item-content">
                                <span class="bt-xin" id="submitForm" onclick="OrderQuery();">查询</span>
                                <span class="bt-xin-no" onclick="OrderQuery('reset');">重置</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="geduan-xin"></div>
    <div class="flexigrid flexigrid-xin" style=" padding-right: 1px; ">
        <div class="tableDiv  bubbleInfo">
            {empty name="list"}
            <table cellspacing="0" cellpadding="0" style="width: 100%;">
                <thead>
                    <tr>
                        <th> <div class="">商品信息</div> </th>
                        <th class="w240"> <div class="">单价/数量</div> </th>
                        <th class="w240"> <div class="">实付款</div> </th>
                        <th class="w240"> <div class="">买家/收货人</div> </th>
                        <th class="w140"> <div class="">支付方式</div> </th>
                        <th class="w140"> <div class="">状态</div> </th>
                        <th class="w200"> <div class="">操作</div> </th>
                    </tr>
                </thead>
                <tbody>
                    
                </tbody>
            </table>
            <div class="no_row">
                <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
            </div>
            {else/}
            <table cellspacing="0" cellpadding="0" style="width: 100%;">
                <thead>
                    <tr>
                        <th> <div class="">商品信息</div> </th>
                        <th class="w240"> <div class="">单价/数量</div> </th>
                        <th class="w240"> <div class="">实付款</div> </th>
                        <th class="w240"> <div class="">买家/收货人</div> </th>
                        <th class="w140"> <div class="">支付方式</div> </th>
                        <th class="w140"> <div class="">状态</div> </th>
                        <th class="w210"> <div class="">操作</div> </th>
                    </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                    <tr class="order-empty"><td colspan="7"></td></tr>
                    <tr>
                        <td class="biaotou" colspan="7">
                            <span class="mr15">
                                <span class="mr15">订单号：{$vo.order_code} <a class="copy order_code" onclick="OrderCopy();" data-clipboard-text="{$vo.order_code}"><i class="iconfont e-fuzhi basics-color" title="点击复制"></i></a></span>
                                {eq name="$vo.order_source" value="30"}<span class="mr15" style="position: relative;"><i class="iconfont e-jifen" title="积分商城订单"></i></span>{/eq}
                                <span class="fr"><i class="iconfont e-shijian mr5"></i>{$vo.add_time}</span>
                            </span>
                        </td>
                    </tr>
                    <tr>
                        {volist name="$vo.Details" id="do"}
                            {eq name="$i" value="1"}
                            <td>
                                <div class="goods-detail">
                                    <div class="goods-image">
                                        <a><img src="{$do.litpic}"></a>
                                        <!-- <a href="{$do.arcurl}" target="_blank"><img src="{$do.litpic}"></a> -->
                                    </div>
                                    <div class="goods-info">
                                        <p class="goods-title">{$do.product_name}</p>
                                        <p class="goods-spec">{$do.product_spec}</p>
                                        {if condition="!empty($do.apply_service) && !empty($do.service_id)"}
                                        <p class="after-sale"><a href="{:url('ShopService/after_service_details', array('service_id' => $do['service_id'], 'backurl'=>url('ShopService/after_service')))}" title="点击查看详情"><span>{$do.status_name}</span></a></p>
                                        {/if}
                                    </div>
                                </div>
                            </td>
                            <td class=""><p>￥{$do.product_price} x {$do.num}</p></td>
                            {/eq}
                        {/volist}
                    
                        <td class="" rowspan="{$vo.rowspan}">
                            <p style="color: #636669; font-weight: 600;">
                                {eq name="$vo.order_source" value="30"}{$vo.pay_use_scores_num}积分兑换{else/}￥{$vo.pay_use_cash}{/eq}
                                {eq name="$vo.shipping_fee" value="0"}
                                <span style="font-weight: 400;">(包邮)</span>
                                {else/}
                                <span style="font-weight: 400;">(运费：￥{$vo.shipping_fee})</span>
                                {/eq}
                            </p>
                        </td>
                    
                        <td class="" rowspan="{$vo.rowspan}">
                            <div class="w220 p0">
                                <p><a class="basics-color" href="javascript:void(0);" data-href="{:url('Member/users_edit', ['id'=>$vo.users_id,'from'=>'money_index','iframe'=>1])}" onclick="openFullframe(this, '会员资料','100%','100%');">{$vo.u_nickname}</a></p>
                                {eq name="$vo.prom_type" value="0"}
                                <p>{$vo.consignee}&nbsp;&nbsp;{$vo.mobile}</p>
                                {else/}
                                <p>{$vo.u_nickname}&nbsp;&nbsp;{$vo.u_mobile}</p>
                                {/eq}
                                <p class="ellipsis">{$vo.all_address|msubstr=###,0,16,true}<a class="copy address_code curpoin" onclick="addressCopy();" data-clipboard-text="{$vo.province}-{$vo.city}-{$vo.district}-{$vo.address}，收货人：{$vo.consignee}，手机号：{$vo.mobile}"><i class="iconfont e-fuzhi ml5 basics-color" title="点击复制"></i></a></p>
                            </div>
                        </td>
                            
                        <td class="" rowspan="{$vo.rowspan}">
                            <span class="am-badge am-badge-secondary">
                                {eq name="$vo.order_source" value="30"}积分兑换{else/}{$pay_method_arr[$vo.pay_name]|default='微信支付'}{/eq}
                            </span>
                        </td>

                        <td class="" rowspan="{$vo.rowspan}">
                            <p>
                                <span class="zt {eq name='$vo.order_status' value='0'}show{else/}none{/eq}" style="color: #ff1f2c">待付款</span>
                                <span class="zt {eq name='$vo.order_status' value='1'}show{else/}none{/eq}" style="color: #ff9900">待发货</span>
                                <span class="zt {eq name='$vo.order_status' value='2'}show{else/}none{/eq}" style="color: #2d8cf0;">已发货</span>
                                <span class="zt {eq name='$vo.order_status' value='3'}show{else/}none{/eq}" style="color: #19be6b;">已完成</span>
                                <span class="zt {if condition='4 == $vo.order_status'}show{else/}none{/if}" style="color: #939799;">已过期</span>
                                <span class="zt {if condition='-1 == $vo.order_status'}show{else/}none{/if}" style="color: #939799;">已关闭</span>
                            </p>
                        </td>
                        <td rowspan="{$vo.rowspan}">
                            <div class="operation">
                                <a class="bt" href="{:url('Shop/order_details',array('order_id'=>$vo['order_id']))}" title="订单详情">详情</a>
                                <i></i>
                                <a class="bt" href="javascript:void(0);" data-href="{:url('shop/order_remarks', ['order_id'=>$vo.order_id])}" onclick="openFullframe(this, '商家备注', '600px', '50%');" title="订单备注">备注</a>
                                {eq name="$vo.order_status" value='0'}
                                <!-- 订单未付款时出现 -->
                                <i></i>
                                <a href="JavaScript:void(0);" onclick="OrderMark('yfk', '{$vo.order_id}', '{$vo.users_id}');" class="bt" title="确认付款">付款</a>
                                <i></i>
                                <a href="JavaScript:void(0);" onclick="PromptChangePrice('{$vo.order_id}', '{$vo.pay_use_cash}');" class="bt" title="订单改价">改价</a>
                                <script type="text/javascript">
                                    // 弹出改价输入框
                                    function PromptChangePrice(order_id, pay_use_cash) {
                                        layer.prompt({
                                            formType: 3,
                                            shade: layer_shade,
                                            move: false,
                                            title: '提示',
                                            id: 'BulkSetPrice',
                                            btnAlign:'r',
                                            closeBtn: 3,
                                            btn: ['确定', '关闭'],
                                            success: function(layero, index) {
                                                $("#BulkSetPrice").find('input').attr('placeholder', '请输入应付金额');
                                                $("#BulkSetPrice").find('input').attr('value', pay_use_cash);
                                                $("#BulkSetPrice").find('input').attr('onkeyup', "this.value=this.value.replace(/[^\\d.]/g,'')");
                                                $("#BulkSetPrice").find('input').attr('onpaste', "this.value=this.value.replace(/[^\\d.]/g,'')");
                                                var msg = '<span style="color: red;">改价后让用户重新进入订单列表点击支付</span>';
                                                $("#BulkSetPrice").append(msg);
                                                // 修改订单金额后为保证支付金额准确有效<br/>请让用户刷新订单列表页后重新点击支付
                                            }
                                        }, function(price, index) {
                                            if (0 < price) {
                                                layer.close(index);
                                                OrderChangePrice(order_id, pay_use_cash, price);
                                            } else {
                                                layer.msg('应付金额不允许为0', {time: 1500});
                                            }
                                        });
                                    }

                                    // 提交改价数据并追加一条订单操作记录
                                    function OrderChangePrice(OrderID, payUseCash, Price) {
                                        if (0 >= Price) layer.msg('应付金额不允许为0', {time: 1500});
                                        layer_loading('正在处理');
                                        $.ajax({
                                            type : 'post',
                                            url  : "{:url('Shop/order_change_price')}",
                                            data : {
                                                order_id: OrderID,
                                                pay_use_cash_old: payUseCash,
                                                pay_use_cash: Price,
                                                _ajax: 1
                                            },
                                            dataType : 'json',
                                            success : function(res) {
                                                layer.closeAll();
                                                if (1 == res.code) {
                                                    layer.msg(res.msg, {time: 1500}, function() {
                                                        window.location.reload();
                                                    });
                                                } else {
                                                    layer.alert(res.msg, {title: false, closeBtn: 0}, function() {
                                                        window.location.reload();
                                                    });
                                                }
                                            }
                                        });
                                    }
                                </script>
                                <i></i>
                                <a href="JavaScript:void(0);" onclick="OrderMark('gbdd', '{$vo.order_id}', '{$vo.users_id}');" class="bt" title="关闭订单">关闭</a>
                                <!-- END -->
                                {/eq}

                                {eq name="$vo.order_status" value='1'}
                                <!-- 订单待发货时出现 -->
                                <i></i>
                                <a href="JavaScript:void(0);" data-url="{:url('Shop/order_send', ['order_id'=>$vo.order_id])}" onclick="OrderSend(this);" class="bt" title="确认发货">发货</a>
                                {notempty name="$LogData[$vo.order_id]['action_count']"}
                                <i></i>
                                <span class="bt" title="发货提醒">提醒<em class="num">{$LogData[$vo.order_id]['action_count']}</em></span>
                                {/notempty}
                                {/eq}

                                {eq name="$vo.order_status" value='2'}
                                <!-- 订单已发货时出现 -->
                                <i></i>
                                <a href="JavaScript:void(0);" onclick="OrderMark('ysh','{$vo.order_id}','{$vo.users_id}');" class="bt" title="确认收货">完成</a>
                                <input type="hidden" id="beizhu-url" value="{:url('Shop/update_note')}">
                                {/eq}

                                {if condition="-1 == $vo.order_status or 3 == $vo.order_status"}
                                <input type="hidden" id="beizhu-url" value="{:url('Shop/update_note')}">
                                {/if}
                                {if condition='-1 == $vo.order_status or 4 == $vo.order_status'}
                                <i></i>
                                <a class="bt" href="JavaScript:void(0);" onclick="OrderMark('ddsc','{$vo.order_id}','{$vo.users_id}');" title="订单删除">删除</a>
                                {/if}
                            </div>
                        </td>
                    </tr>

                    {volist name="$vo.Details" id="do"}
                    {gt name="$i" value="1"}
                    <tr>
                        <td>
                            <div class="goods-detail">
                                <div class="goods-image">
                                    <a><img src="{$do.litpic}"></a>
                                    <!-- <a href="{$do.arcurl}" target="_blank"><img src="{$do.litpic}"></a> -->
                                </div>
                                <div class="goods-info">
                                    <p class="goods-title">{$do.product_name}</p>
                                    <p class="goods-spec">{$do.product_spec}</p>
                                    {if condition="!empty($do.apply_service) && !empty($do.service_id)"}
                                    <p class="after-sale"><a href="{:url('ShopService/after_service_details', array('service_id' => $do['service_id'], 'backurl'=>url('ShopService/after_service')))}"><span>{$do.status_name}</span></a></p>
                                    {/if}
                                </div>
                            </div>
                        </td>
                        <td class=""><p>￥{$do.product_price} X {$do.num}</p></td>
                    </tr>
                    {/gt}
                    {/volist}
                {/volist}
                </tbody>
            </table>
            {/empty}
        </div>
        {notempty name="list"}
        <div class="tDiv">
            <div class="tDiv2">
                <!-- <div class="fbutton checkboxall">
                    <input type="checkbox" autocomplete="off" class="checkAll">
                </div>
                <div class="fbutton">
                    <a onclick="batch_del(this, 'ids');" data-url="{:url('Shop/order_del')}" class="layui-btn layui-btn-primary">
                            <span>批量删除</span>
                    </a>
                </div> -->
                {include file="public/page" /}
            </div>
            <div style="clear:both"></div>
        </div>
        {/notempty}
    </div>
</div>

<script type="text/javascript">
    $(function() {

        $(document).keydown(function(event){
            if (event.keyCode ==13) {
                $('#searchForm input[type=text]').each(function(index, item){
                    if ($(item).is(':focus')) {
                        $('#searchForm').submit();
                    }
                });
            }
        });

        $('input[name*=ids]').click(function() {
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]').prop('checked',this.checked);
        });
    });

    $(document).ready(function() {
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function() {
            $(this).toggleClass('trSelected');
        });
    });

    // AJAX调用下载
    function OrderExcelExport(obj) {
        layer_loading('正在导出');
        $.ajax({
            type: 'post',
            url : $(obj).attr('data-url'),
            data: {
                _ajax: 1,
                // 导出类型，商城订单固定值1
                export_type: 1,
                // 搜索条件信息，可为空
                pay_name: "{$pay_name}",
                order_code: "{$Request.param.order_code}",
                end_time: "{$Request.param.add_time_end}",
                start_time: "{$Request.param.add_time_begin}",
                order_status: "{$Request.param.order_status}",
                order_terminal: "{$order_terminal}",
                contains_virtual: "{$contains_virtual}",
            },
            dataType: 'json',
            success: function(res) {
                layer.closeAll();
                if (1 == res.code) {
                    window.location.href = res.url;
                } else {
                    showErrorAlert(res.msg);
                }
            },
            error: function(e) {
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    }
    // 订单号复制
    function addressCopy() {
        var clipboard1 = new Clipboard(".address_code");
        clipboard1.on("success", function(e) {
            layer.msg("复制成功");
        });
        clipboard1.on("error", function(e) {
            layer.msg("复制失败！请手动复制", {icon: 5});
        }); 
    }

    // 订单号复制
    function OrderCopy() {
        var clipboard1 = new Clipboard(".order_code");
        clipboard1.on("success", function(e) {
            layer.msg("复制成功");
        });
        clipboard1.on("error", function(e) {
            layer.msg("复制失败！请手动复制", {icon: 5});
        }); 
    }

    // 订单查询
    function OrderQuery(isReset) {
        if (isReset && 'reset' == isReset) {
            window.location.href = "{:url('Shop/index', ['order_status'=>$Request.param.order_status])}";
        } else {
            $('#searchForm').submit();
        }
    }

    // 订单发货
    function OrderSend(obj) {
        var url = $(obj).attr('data-url');

        // iframe窗
        var iframes = layer.open({
            type: 2,
            title: '订单发货详情',
            fixed: true, //不固定
            shadeClose: false,
            shade: layer_shade,
            area: ['840px', '600px'],
            content: url
        });
        // layer.full(iframes);
    }

    // 订单操作
    function OrderMark(status_name, order_id, users_id, admin_note, update_time) {
        if('yfk' == status_name) {
            var msg = '确认订单已付款？';
        } else if ('ysh' == status_name) {
            var msg = '确认订单已收货？';
        } else if ('gbdd' == status_name) {
            var msg = '确认关闭订单？';
        } else if ('ddbz' == status_name) {
            layer.prompt({
                formType: 2,
                shade: layer_shade,
                value: admin_note,
                title: '提示',
                closeBtn: 3,
                id: 'AdminNote',
                area: ['300px', '100px'],
                success: function(layero, index) {
                    if (admin_note) {
                        var msg = '<br/><span style="color: #999; font-size: 12px;">最后更新：'+update_time+'</span>';
                        $("#AdminNote").append(msg);
                        $(".layui-layer-content").css('text-align', 'left');
                    }
                }
            }, function(value, index, elem) {
                OrderNote(order_id,value);
                layer.close(index);
            });
            return false;
        } else if ('sdtk' == status_name) {
            layer.prompt({
                formType: 2,
                shade: layer_shade,
                value: ' ',
                title: '提示',
                closeBtn: 3,
                id: 'manualRefund',
                btnAlign:'r',
                btn: ['关闭并退款', '取消'],
                area: ['300px', '100px'],
                success: function(layero, index) {
                    var msg = '<span style="color: red; font-size: 16px;">是否确认手动关闭订单并自行退款？</span><br/><br/> <span style="color: #999; font-size: 14px;">请填写手动关闭订单原因(非必填)。</span><br/><br/> ';
                    $("#manualRefund").prepend(msg);
                    $(".layui-layer-content").css('text-align', 'left');
                }
            }, function(value, index, elem) {
                // 手动关闭订单并退款
                ManualRefund(order_id, value);
                layer.close(index);
            });
            return false;
        } else if ('ddsc' == status_name) {
            var msg = '确认删除订单？';
        }

        layer.confirm(msg, {
            shade: layer_shade,
            area: ['480px', '190px'],
            move: false,
            title: '提示',
            btnAlign:'r',
            closeBtn: 3,
            btn: ['确定','取消'], //按钮
            success: function () {
                $(".layui-layer-content").css('text-align', 'left');
            }
        }, function() {
            $.ajax({
                url: "{:url('Shop/order_mark_status')}",
                data: {order_id:order_id,status_name:status_name,users_id:users_id, _ajax:1},
                type:'post',
                dataType:'json',
                success:function(res) {
                    layer.closeAll();
                    if (1 == res.code) {
                        layer.msg(res.msg, {time: 1500},function(){
                            window.location.reload();
                        });
                    } else {
                        layer.msg(res.msg, {time: 1500});
                    }
                }
            });
        },function(index) {
            layer.closeAll(index);
        });
    }

    // 订单备注
    function OrderNote(order_id, admin_note) {
        $.ajax({
            url: "{:url('Shop/update_note')}",
            data: {order_id:order_id,admin_note:admin_note, _ajax:1},
            type:'post',
            dataType:'json',
            success:function(res){
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {time: 1500},function(){
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.msg, {time: 1500});
                }
            }
        });
    }

    // 手动关闭订单并退款
    function ManualRefund(order_id, refund_note) {
        $.ajax({
            url: "{:url('Shop/order_manual_refund')}",
            data: {order_id: order_id, refund_note: refund_note, _ajax: 1},
            type:'post',
            dataType:'json',
            success:function(res) {
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {time: 1500}, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.msg, {time: 1500});
                }
            }
        });
    }

    // 查看手动退款原因
    function BrowseRefundNote(layer_str) {
        layer.confirm(layer_str, {title: '提示',shade: layer_shade, closeBtn: 3, btn: ['关闭'],btnAlign:'r', area: ['25%', '25%']});
    }
</script>

<!-- 日期联动选择js文件 start -->
{eyou:static file="__PUBLIC__/static/common/js/ey_laydate_time_linkage.js"/}
<!-- 日期联动选择js文件 end -->
{include file="public/footer" /}
<script type="text/javascript">
    try{
        var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
        if (mt20_1649209614 == 1){
            $("#geduan_div").removeClass("h15");
        } else {
            $("#geduan_div").addClass("h15");
        }
    }catch(e){}
</script>